> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jaypopat/cf_ai_duet/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting via SSH

> Learn how to connect to Duet using SSH

Duet is accessed entirely through SSH. No installation or downloads required - just connect using your terminal's SSH client.

## Hosted Version

Connect to the hosted instance of Duet:

```bash theme={null}
ssh <username>@duet.jaypopat.me
```

Replace `<username>` with your desired username. This will identify you in pairing sessions.

## Local Development

If you're running Duet locally for development:

<Steps>
  <Step title="Start the server">
    Run the development environment:

    ```bash theme={null}
    make dev
    ```

    This starts the SSH server on port 2222 and the Cloudflare worker locally.
  </Step>

  <Step title="Connect via SSH">
    Connect to your local instance:

    ```bash theme={null}
    ssh <username>@localhost -p 2222
    ```
  </Step>
</Steps>

## Server Configuration

When running your own Duet server, you can configure it using command-line flags (see main.go:12-14):

* `--addr` - SSH server address (default: `:2222`)
* `--hostkey` - Path to SSH host key (default: `.ssh/id_ed25519`)
* `--worker` - Duet CF Worker base URL for AI features

Example:

```bash theme={null}
./duet --addr :2222 --hostkey ~/.ssh/id_ed25519 --worker https://duet-cf-worker.example.workers.dev
```

## After Connecting

Once connected, you'll see the launch screen where you can:

* Create a new pairing room
* Join an existing room

See [Creating Rooms](/guides/creating-rooms) for next steps.

## Troubleshooting

### Connection Refused

If you get "Connection refused":

* Verify the server is running
* Check the port number (2222 for local, 22 for hosted)
* Ensure your firewall allows outbound SSH connections

### Authentication Failed

Duet uses SSH key authentication. Ensure:

* Your SSH client is configured with valid keys
* The server has a valid host key at the configured path

### Username Issues

If you don't specify a username, Duet will assign you the default username "guest" (see internal/ui/model.go:85-87).
